package dto

import (
	"time"
)

// UserInfo 用户信息表模型
type UserInfo struct {
	ID               int64     `gorm:"primaryKey;autoIncrement;comment:主键ID"`
	UserID           string    `gorm:"type:varchar(64);not null;uniqueIndex;comment:用户唯一ID"`
	UserName         string    `gorm:"type:varchar(50);not null;uniqueIndex;comment:用户名"`
	Password         string    `gorm:"type:varchar(128);not null;comment:加密后的密码"`
	Phone            string    `gorm:"type:varchar(20);uniqueIndex;comment:手机号"`
	AvatarURL        string    `gorm:"type:varchar(255);comment:头像URL"`
	UserIntroduction string    `gorm:"type:varchar(255);comment:个性签名"`
	Status           string    `gorm:"type:enum('online','offline');default:'offline';comment:在线状态"`
	LastOnlineTime   time.Time `gorm:"comment:最后一次在线时间"`
	Used             string    `gorm:"type:varchar(20);default:'1';comment:是否可用(1:可用,0:禁用)"`
	CreateTime       time.Time `gorm:"autoCreateTime;comment:创建时间"`
	UpdateTime       time.Time `gorm:"autoUpdateTime;comment:更新时间"`
}

// TableName 设置表名
func (UserInfo) TableName() string {
	return "user_info"
}
